package yunwo.cn.yzstation.adapter;

import android.content.Context;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;
import android.widget.Toast;

import yunwo.cn.yzstation.R;
import yunwo.cn.yzstation.base.BasicAdapter;
import yunwo.cn.yzstation.bean.ItemlistBean;

/**
 * Created by lao on 2017/9/9.
 */

public class ScanCarLvAdapter extends BasicAdapter<ItemlistBean.DataBean> {
    public ScanCarLvAdapter(Context mctx) {
        super(mctx);
    }

    @Override
    protected int setItemLayout() {
        return R.layout.item_scancar;
    }

    @Override
    protected void bindData(View convertView, ItemlistBean.DataBean data, final int position) {
        ImageView Remove = get(convertView, R.id.Remove);
        TextView waybillTV = get(convertView, R.id.waybillTV);
        TextView goodsNameTV = get(convertView, R.id.goodsNameTV);
        TextView destinationTV = get(convertView, R.id.destinationTV);
        waybillTV.setText(data.getSubTrackingNumber());
        goodsNameTV.setText(data.getConsigneeName());
        destinationTV.setText(data.getEndOrganName());
        Remove.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                datas.remove(position);
                notifyDataSetChanged();
            }
        });
    }
}
